package mc.contents.pojo.view;

import mc.support.util.PlainUtil;
import mc.support.util.TaobaoPojoUtil;
import java.io.Serializable;
/**
 * Created with IntelliJ IDEA. <br/>
 * User: francis    <br/>
 * Date: 13-11-6    <br/>
 * Time: 16:51  <br/>
 */
public class Rank extends mc.support.crawler.Rank implements Serializable{
    private static final long serialVersionUID = -5846172220967914513L;
    private String detailUrl;
    private String ip;
    private String ipAdd;
    private Long volume;
    private String outerId;


    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getIpAdd() {
        return ipAdd;
    }

    public void setIpAdd(String ipAdd) {
        this.ipAdd = ipAdd;
    }

    public Long getVolume() {
        return volume;
    }

    public void setVolume(Long volume) {
        this.volume = volume;
    }

    public String getOuterId() {
        return outerId;
    }

    public void setOuterId(String outerId) {
        this.outerId = outerId;
    }

    public String getDetailUrl() {
        if(null != this.getItemId()){
            this.detailUrl =  PlainUtil.connectToStr(TaobaoPojoUtil.getDetailUrlPrefix(), this.getItemId());
        }
        return detailUrl;
    }

    public void setDetailUrl(String detailUrl) {
        this.detailUrl = detailUrl;
    }

    @Override
    public boolean equals(Object obj) {
        if ( obj instanceof Rank ) {
            return super.getItemId() == ((Rank) obj).getItemId();
        }
        return false;
    }

    @Override
    public int hashCode() {
        return (int) ((int) ( getItemId().longValue() >> 32 ) & getItemId().longValue());
    }
}
